<?php

    class AdminUser extends WebUser
    {
        private $username = ADMIN_USERNAME;
        private $password = ADMIN_PASSWORD;

        const LOGIN_PAGE = 'AdminLogin';

        public function Initialize()
        {
            $this->isRememberMeEnabled = true;

            parent::Initialize();
        }

        public function Authenticate($username, $password)
        {
            return ( $username == $this->username )
                && ( $this->GetPasswordHash($password) == $this->password );
        }

        private function GetPasswordHash( $password )
        {
            return sha1($password);
        }

        public function GetLoginUrl()
        {
            return Pages::GetPageUrl(self::LOGIN_PAGE);
        }
    }

?>